﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
    public class DonGiaObj
    {
        private string _DongiaID;

        public string DongiaID
        {
            get { return _DongiaID; }
            set { _DongiaID = value; }
        }
        private string _HangID;

        public string HangID
        {
            get { return _HangID; }
            set { _HangID = value; }
        }
        private string _Ngaybatdau;

        public string Ngaybatdau
        {
            get { return _Ngaybatdau; }
            set { _Ngaybatdau = value; }
        }
        private string _Ngayketthuc;

        public string Ngayketthuc
        {
            get { return _Ngayketthuc; }
            set { _Ngayketthuc = value; }
        }
        private string _NhanvienID;

        public string NhanvienID
        {
            get { return _NhanvienID; }
            set { _NhanvienID = value; }
        }
        private string _Giathitruong;

        public string Giathitruong
        {
            get { return _Giathitruong; }
            set { _Giathitruong = value; }
        }
        private string _Giabanle;

        public string Giabanle
        {
            get { return _Giabanle; }
            set { _Giabanle = value; }
        }
        private string _Giabanbuon;

        public string Giabanbuon
        {
            get { return _Giabanbuon; }
            set { _Giabanbuon = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }

        public DonGiaObj SetValuesFromDataReader(IDataReader reader)
        {
            DonGiaObj obj = new DonGiaObj();
            obj.DongiaID = (reader["DongiaID"] is DBNull) ? String.Empty : reader["DongiaID"].ToString();
            obj.HangID = (reader["HangID"] is DBNull) ? String.Empty : reader["HangID"].ToString();
            obj.Ngaybatdau = (reader["Ngaybatdau"] is DBNull) ? String.Empty : reader["Ngaybatdau"].ToString();
            obj.Ngayketthuc = (reader["Ngayketthuc"] is DBNull) ? String.Empty : reader["Ngayketthuc"].ToString();
            obj.NhanvienID = (reader["NhanvienID"] is DBNull) ? String.Empty : reader["NhanvienID"].ToString();
            obj.Giathitruong = (reader["Giathitruong"] is DBNull) ? "0" : reader["Giathitruong"].ToString();
            obj.Giabanle = (reader["Giabanle"] is DBNull) ? "0" : reader["Giabanle"].ToString();
            obj.Giabanbuon = (reader["Giabanbuon"] is DBNull) ? "0" : reader["Giabanbuon"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            return obj;
        }
    }

}
